<script>
jQuery(document).ready(function($) {
			 $( "#dialogModal" ).dialog({
				height: 'auto',
				width: 'auto',
				autoOpen: false,
				show: {
					effect: "blind",
					duration: 500
					
					},
				hide: {
					effect: "blind",
					duration: 500
					},
				modal: true,
				
				});
    //respond to click event on anything with 'overlay' class
			$(".overlay").click(function(event){
				event.preventDefault();
				$('#contentWrap').load($(this).attr("href"));  //load content from href of link
				$('#dialogModal').dialog('option', 'title', $(this).attr("title"));  //make dialog title that of link
				$('#dialogModal').dialog('open');  //open the dialog
				});
				
});
Number.prototype.format = function(n, x) {
	var re = '\\d(?=(\\d{' + (x || 3) + '})+' + (n > 0 ? '\\.' : '$') + ')';
	return this.toFixed(Math.max(0, ~~n)).replace(new RegExp(re, 'g'), '$&,');
};
</script>
<div id="dialogModal">
     <!-- the external content is loaded inside this tag -->
     <div id="contentWrap"></div>
</div>
<div class="cate-infor">
	<div class="block-title">
		<h3>Danh sách nhân viên</h3>	
		<?php echo $this->Html->link(__('Thêm nhân viên', true), array("controller"=>"Users", "action"=>"add"), array("class"=>"overlay add_service", "title"=>"Thêm nhân viên"));?>
		
	</div>
	<div class="block-content">
		
		<style>
		.dv{
		font: 12px sans-serif;
		}
		
.row {
    margin-bottom: 8px;
    overflow: hidden;
}
.row input,.row select {
    border: 1px solid #c0c0c0;
    padding: 3px;
	}
.row label {
    float: left;
    width: 100px;
}
.row textarea {
    border: 1px solid #c0c0c0;
    box-sizing: border-box;
    max-width: 256px;
    min-height: 70px;
    padding: 4px;
    width: 256px;
}
.btn-dialog {
    border-top: 1px solid #c0c0c0;
    margin-top: 10px;
    padding: 10px 2px 0 0;
    text-align: right;
}
.btn-dialog input {
    border: 1px solid #c0c0c0;
    cursor: pointer;
    padding: 3px 10px;
}
.btn-dialog input[type="button"] {
    float: right;
    margin-left: 10px;
}

		</style>
		<table cellspacing="0" cellpadding="0" width="100%" class="dv">
			<tr>
				<th style="text-align: center; width: 4%;">STT</th>
				<th style="text-align: center; width: 23%;">Tên nhân viên</th>
				<th style="text-align: center; width: 11%;">Tên đăng nhập</th>
				<th style="text-align: center; width: 10%;">Tên nhóm</th>
				<th style="text-align: center; width: 11%;">Điện thoại</th>
				<th style="text-align: center; width: 10%;">Ngày vào làm</th>
				<th style="text-align: center; width: 11%;">Thao tác</th>
				</tr>
			<?php $i= 0; foreach($users as $k=>$v){ $i++;?>			
			<tr>
				<td style="text-align: center"><?php echo $i;?></td>
				<td style="text-align: left; padding-left: 6px; box-sizing: border-box;"><?php echo $v['User']['name'];?></td>
				<td style="text-align: center;  box-sizing: border-box;"><?php echo $v['User']['username'];?></td>
				<td style="text-align: right; padding-right: 6px; box-sizing: border-box;"><?php echo $v['User']['groups_id'];?></td>
				<td style="text-align: right; padding-right: 6px; box-sizing: border-box;"><?php echo $v['User']['phone'];?></td>
				<td style="text-align: right; padding-right: 6px; box-sizing: border-box;"><?php echo $v['User']['start'];?>
				</td>
				<td style="text-align: center"><?php echo $this->Html->link(__('Sửa', true), array("controller"=>"users", "action"=>"edit",$v['User']['id']), array("class"=>"overlay", "title"=>"Sửa thông tin nhân viên"));?> | <?php echo $this->Html->link(__('Xóa', true), array('action' => 'delete', $v['User']['id']), null, sprintf(__('Bạn có chắc muốn xóa mục này không ?', true), $v['User']['id'])); ?></td>
			</tr>
			<?php  }?>
		</table>		
	</div>
</div>
<?php echo $this->Html->script('jquery.maskMoney');?>

 
 